import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    flag: false,
    bgColor: {
      rgba: 0,
      ParameterOne: 0,
      ParameterTwo: 0,
      ParameterThree: 0
    }
  },
  mutations: {
    changFlag (state) {
      state.flag = false
    },
    showFlag (state) {
      state.flag = true
    },
    getRandom (state) {
      state.bgColor.rbga = Math.round(Math.random() * 100) / 100
      state.bgColor.ParameterOne = Math.floor(Math.random() * (100 - 0 + 1)) + 0
      state.bgColor.ParameterTwo = Math.floor(Math.random() * (200 - 0 + 1)) + 0
      state.bgColor.ParameterThree = Math.floor(Math.random() * (300 - 0 + 1)) + 0
    }
  },
  actions: {
  },
  modules: {
  }
})
